#ifndef ENHANCEWRAPPER_H
#define ENHANCEWRAPPER_H

#include <QDebug>
#include <QObject>

#include <time.h>
#include <math.h>

#include <openvino/openvino.hpp>
#include <opencv2/opencv.hpp>

#include "Network/DebugTools.h"
#include "Network/NetworkTools.h"


class EnhanceWrapper : public QObject
{
    Q_OBJECT
public:
    explicit EnhanceWrapper(QString xmlPath, QObject *parent = nullptr);

public:
    cv::Mat infer(QString imageSrc);

private:
    // post process
    void toHWC(const QVector<float> &buffer, std::vector<float> &outBuffer, cv::Size bufferSize);
    cv::Mat postProcess(const QVector<float> &buffer, cv::Size oriSize);

    // infer process
    QVector<float> _infer(cv::Mat transDim);

    // pre process
    std::pair<cv::Mat, cv::Size> preprocess(QString imageSrc);

private:
    std::shared_ptr<ov::Model> xmlModel;
    ov::CompiledModel compiledModel;
};

#endif // ENHANCEWRAPPER_H
